﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ww.wwf.wwfbll;
using ww.lis.lisbll.sam;
using System.Collections;
using System.IO;

namespace ww.form.lis.sam.jy
{
    public partial class EditDataForm : ww.form.wwf.SysBaseForm
    { /// <summary>
        /// 逻辑_仪器
        /// </summary>
        jybll blljy = new jybll();
        string strCurrSelfjy_id = "";
        private JYInstrDataBll bllInstrIO = new JYInstrDataBll();
        
        private void bllInit()
        {
            try
            {
                //仪器
                InstrBLL bllInstr = new InstrBLL();
                DataTable dtInstr = bllInstr.BllInstrDTByUseAndGroupID(1, ww.wwf.wwfbll.LoginBLL.strDeptID);//仪器列表
                fjy_instrComboBox.DataSource = dtInstr;

                jymodel jym = blljy.GetModel(strCurrSelfjy_id);

                fjy_instrComboBox.SelectedValue = jym.fjy_instr;
                fjy_dateDateTimePicker.Value = Convert.ToDateTime(jym.fjy_date);
                fjy_yb_codeTextBox.Text = jym.fjy_yb_code;
                freport_timedateTimePicker.Value = Convert.ToDateTime(jym.freport_time);
                fcheck_timedateTimePicker.Value = Convert.ToDateTime(jym.fcheck_time);
            }
            catch (Exception ex)
            {
                WWMessage.MessageShowError(ex.Message.ToString());
            }
        }

        public EditDataForm(string _strCurrSelfjy_id)
        {
            InitializeComponent();
            strCurrSelfjy_id = _strCurrSelfjy_id;
        }

        private void buttonTC_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void CopyDataForm_Load(object sender, EventArgs e)
        {
            bllInit();
        }

        private void button保存_Click(object sender, EventArgs e)
        {
            int intRRR = this.blljy.UpdateSAM_JY_Time(strCurrSelfjy_id, this.freport_timedateTimePicker.Value.ToString("yyyy-MM-dd HH:mm:ss"), this.fcheck_timedateTimePicker.Value.ToString("yyyy-MM-dd HH:mm:ss"));
            this.DialogResult = DialogResult.OK;
        }
    }
}